<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Visualisation for AusStage statistical information</title>
<script type="text/javascript" src="assets/d3.js"></script>
</head>
<body>

<!-- <p><font color="red"> // Metric Visualisations / AusStageMatrices.xlsx </font></p>-->

<!-- Events By Status And Primary Genre  -->
<table width="800"><tr>
<td width="70%"><b>Events By Status And Primary Genre</b></td>
<td width="10%"><a href="javascript:void(0)" onclick="open_win_EventsByStatusAndPrimaryGenre()">Chart</a></td>
<td width="10%"><a href="chart?task=EventsByStatusAndPrimaryGenre&format=csv">CSV</a></td>
<td width="10%"><a href="chart?task=EventsByStatusAndPrimaryGenre&format=json">JSON</a></td>  
</tr></table>
<script type="text/javascript">
function open_win_EventsByStatusAndPrimaryGenre(){
	window.open("EventsByStatusAndPrimaryGenre.html","Events By Status And Primary Genre", "width=800,height=500");
}
</script>

<br>
<!-- Events By State And Primary Genre -->
<table width="800"><tr>
<td width="70%"><b>Events By State And Primary Genre</b></td>
<td width="10%"><a href="javascript:void(0)" onclick="open_win_EventsByStateAndPrimaryGenre()">Chart</a></td> 
<td width="10%"><a href="chart?task=EventsByStateAndPrimaryGenre&format=csv">CSV</a></td>
<td width="10%"><a href="chart?task=EventsByStateAndPrimaryGenre&format=json">JSON</a></td>
</tr></table>
<script type="text/javascript">
function open_win_EventsByStateAndPrimaryGenre(){
	window.open("EventsByStateAndPrimaryGenre.html","Events By State And Primary Genre", "width=700,height=500");
}
</script>

<br>
<!-- Events By State And Status -->
<table width="800"><tr>
<td width="70%"><b>Events By State And Status</b></td> 
<td width="10%"><a href="javascript:void(0)" onclick="open_win_EventsByStateAndStatus()">Chart</a></td> 
<td width="10%"><a href="chart?task=EventsByStateAndStatus&format=csv">CSV</a></td>
<td width="10%"><a href="chart?task=EventsByStateAndStatus&format=json">JSON</a></td>
</tr></table> 
<script type="text/javascript">
function open_win_EventsByStateAndStatus(){
	window.open("EventsByStateAndStatus.html","Events By State And Status", "width=1000,height=500");
}
</script>
<br>

<!-- <p><font color="red"> // Metric Visualisations / Event-count.xlsx </font></p> -->
<!-- Events Count By year  -->
<table width="800"><tr>
<td width="30%"><b>Events Count By Year</b></td>
<td width="20%">Start Year:
	<input type="text" name="start" id="start" size=4 value="1800" onChange="setStartYear(0)">
</td>
<td width="20%">End Year:
	<input type="text" name="end" id="end" size=4 value="2012" onChange="setEndYear(0)">
</td>
<td width="10%"><a href="javascript:void(0)" onclick="open_win_EventCount(0)">Chart</a></td>
<td width="10%"><a id="EventCountByYearCSV" onclick="setQueryString('EventCountByYearCSV', 'CSV',0)">CSV</a></td>
<td width="10%"><a id="EventCountByYearJSON" onclick="setQueryString('EventCountByYearJSON', 'JSON', 0)">JSON</a></td>  
</tr></table> 

<!-- <p><font color="red"> // Metric Visualisations / Event-count-state.xlsx </font></p> -->
<!-- Events Count By Year And State  -->
<table width="800"><tr>
<td width="30%"><b>Events Count By Year and State</b></td>
<td width="20%">Start Year:
	<input type="text" name="start" id="start" size=4 value="1800" onChange="setStartYear(1)">
</td>
<td width="20%">End Year:
	<input type="text" name="end" id="end" size=4 value="2012" onChange="setEndYear(1)">
</td>
<td width="10%"><!-- <a href="javascript:void(0)" onclick="open_win_EventCount(1)">Chart</a>--></td>
<td width="10%"><a id="EventCountByYearAndStateCSV" onclick="setQueryString('EventCountByYearAndStateCSV', 'CSV', 1)">CSV</a></td>
<td width="10%"><a id="EventCountByYearAndStateJSON" onclick="setQueryString('EventCountByYearAndStateJSON', 'JSON', 1)">JSON</a></td>  
</tr></table> 
 
<script type="text/javascript">
	function setStartYear(i){
		var start = document.getElementsByName('start')[i].value;
		validateYear(start);
	}
	
	function setEndYear(i){		
		var end = document.getElementsByName('end')[i].value;
		validateYear(end);
	}
	
	function setQueryString(id, format, i){
		var start = document.getElementsByName('start')[i].value,
			end = document.getElementsByName('end')[i].value;
		
		var queryStr;
		
		if (validateYear(start) && validateYear(end) && isLess(start, end)){
		
			switch(id){
			case "EventCountByYearCSV":
				queryStr = "chart?task=EventsCountByYear&format=" + format + "&start=" + start + "&end=" + end;
				break;
			case "EventCountByYearJSON":
				queryStr = "chart?task=EventsCountByYear&format=" + format + "&start=" + start + "&end=" + end;
				break;
			case "EventCountByYearAndStateCSV":
				queryStr = "chart?task=EventsCountByYearAndState&format=" + format + "&start=" + start + "&end=" + end;
				break;
			case "EventCountByYearAndStateJSON":
				queryStr ="chart?task=EventsCountByYearAndState&format=" + format + "&start=" + start + "&end=" + end;
				break;
			}
		
			document.getElementById(id).setAttribute("href", queryStr);
		} else {
			alert("End year should be greater than start year!");
		}
	}
	
	function open_win_EventCount(i){
		var start = document.getElementsByName('start')[i].value,
			end = document.getElementsByName('end')[i].value;
	
		if (validateYear(start) && validateYear(end) && isLess(start, end)){	
			if (end == ""){ 
				var d = new Date();
				end = d.getFullYear();
			}
			
			switch(i){
			case 0:
				window.open("EventsCountByYear.html?start=" + start + "&end=" + end,"Events Count by Year", "width=1000,height=500");
				break;
			case 1:
				window.open("EventsCountByYearAndState.html?start=" + start + "&end=" + end,"Events Count by Year And State", "width=1000,height=500");
				break;
			case 2:
				window.open("EventsCountBySecondaryGenreAndYear.html?start=" + start + "&end=" + end,"Events Count by Secondary Genre And Year", "width=1000,height=500");
				break;
			}
			
		}else{
			alert("End year should be greater than start year!");
		}		
	}	
	
/* 	function open_win_EventCountByYearAndState(i){
		var start = document.getElementsByName('start')[i].value,
			end = document.getElementsByName('end')[i].value;
	
		if (validateYear(start) && validateYear(end) && isLess(start, end)){	
			if (end == ""){ 
				var d = new Date();
				end = d.getFullYear();
			}
			window.open("EventsCountByYearAndState.html?start=" + start + "&end=" + end,"Events Count by Year And State", "width=1000,height=500");
		}else{
			alert("End year should be greater than start year!");
		}		
	}	 */
	
	
	function validateYear(obj){
		if (obj.length !=0)    {
			var text = /^[0-9]+$/;
			
			if ((obj != "") && (!text.test(obj))){
				alert("Please Enter Numeric Values Only");
				return false;
			}
			if ((obj.length>4) || (obj.length<4)){ 
				alert("Year is not proper. Please check");
				return false;
			}	
		}
		return true;
	}
	
	function isLess(start, end){
		if (start < end) {			
			return true;
		}else if (end == ""){			
			return true;						
		} else
			return false;
	}
</script>


<br>



<p><font color="red"> // Metric Visualisations / secondary-genre-matrix2.xls </font></p>
<table width="800" border="1">
<!-- Events Count By Secondary Genre And Year  -->
<tr>
<form action="/visualisation/chart" method="get" >
<td width="30%">Events Count By Secondary Genre And Year
	<input type="hidden" name="task" size=80 value="EventsCountBySecondaryGenreAndYear"> 
</td>
<td with="20%">Start Year
	<input type="text" name="start" size=4 value="2000">
</td>
<td with="20%">End Year
	<input type="text" name="end" size=4 value="2011">
</td>
<td width="20%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>
</table>
<br>

<p><font color="red"> // Metric Visualisations / record-count.xls</font></p>
<table width="800" border="1">

<!-- Record Count: Node, Edge and Weight  -->
<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">Record Count: Node, Edge and Weight 
	<input type="hidden" name="task" size=80 value="RecordCountNodeEdgeWeight"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>
</table>
<br>

<p><font color="red"> // Metric Visualisations / distribution-of-degree.png </font></p>
<table width="800" border="1">

<!-- Distribution Of Degree   -->
<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">Distribution Of Degree 
	<input type="hidden" name="task" size=80 value="DistributionOfDegree"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>
</table>
<br>
<hr />

<p><font color="red"> // ADSA 2011 / Event-Resource-Count.xls </font></p>
<table width="800" border="1">

<!-- Events Count -->
<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">Events Count 
	<input type="hidden" name="task" size=80 value="EventsCount"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>

<!-- Resource Count -->
<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">Resource Count
	<input type="hidden" name="task" size=80 value="ResourceCount"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>
</table>
<br>

<p><font color="red"> // ADSA 2011 / ADS_Joins-new.xls </font><br>
<!-- <font color="red"> // ADSA 2011 / OnStage_Joins.xls </font> -->
</p>

<table width="800" border="1">

<!-- ADS Joins -->
<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">ADS Joins
	<input type="hidden" name="task" size=80 value="ADSJoin"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>
 
<!-- OnStage Joins -->
<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">OnStage Joins 
	<input type="hidden" name="task" size=80 value="OnStageJoin"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>

<!-- Books Join -->
<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">Books Join 
	<input type="hidden" name="task" size=80 value="BooksJoin"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>
</table>
<br>

<p><font color="red"> // ADSA 2011 / Resource-Type.xls </font></p>
<table width="800" border="1">

<!-- Resource Type Count -->
<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">Resource Type Count
	<input type="hidden" name="task" size=80 value="ResourceTypeCount"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>
</table>
<br>

<p><font color="red"> // ADSA 2011 / AusStageRecordCount.pdf </font></p>
<table width="800" border="1">

<!-- record counts in tables: Event, Venue, Contributor, Organisation, Item -->
<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">Record counts in tables: Event, Venue, Contributor, Organisation, Resource
	<input type="hidden" name="task" size=80 value="RecordCountsInFiveTables"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>
</table>
<br>

<table width="800" border="1">

<!-- Numbers of Contributors by Function, Numbers of Events by Secondary Genre and Numbers of Events by Content Indicator -->
<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">Numbers of Contributors by Function
	<input type="hidden" name="task" size=80 value="NumOfConsByFunction"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>

<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">Numbers of Events by Secondary Genre
	<input type="hidden" name="task" size=80 value="NumOfEvtsBySecGenre"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>

<tr>
<form action="/visualisation/chart" method="get" >
<td width="60%">Numbers of Events by Content Indicator
	<input type="hidden" name="task" size=80 value="NumOfEvtsByContentIndi"> 
</td>
<td width="30%">
	<input type="radio" name="format" value="csv" checked="checked"/> CSV
	<input type="radio" name="format" value="json" /> JSON
</td>
<td width="10%">
	<input type="submit" name="submit" value="Go"/>
</td>
</form>
</tr>
</table>
<br>

</body>
</html>